﻿using System;
using System.Data.Entity;
using EventYard.Models;

namespace EventYard.Data
{
    public class EventContext : DbContext
    {
        public DbSet<User> Users { get; set; }
        public DbSet<Event> Events { get; set; }
        public DbSet<EventUsername> EventUsernames { get; set; }

        public EventContext()
            : base("EventYardDB")
        { 
        }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Entity<User>().HasMany(u => u.Friends).WithMany();
            base.OnModelCreating(modelBuilder);
        }
    }
}
